package com.geeklan.smart.ui.network;

import android.content.Context;
import android.content.Intent;

import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.geeklan.base.base.BaseActivity;
import com.geeklan.base.utils.ActivityUtil;
import com.geeklan.smart.R;
import com.geeklan.smart.databinding.ActivityConnectSuccessBinding;
import com.geeklan.smart.ui.main.MainActivity;

public class ConnectSuccessActivity extends BaseActivity<ActivityConnectSuccessBinding> {

    @Override
    protected ActivityConnectSuccessBinding initBinding() {
        return ActivityConnectSuccessBinding.inflate(getLayoutInflater());
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
        mBinding.tvNext.setOnClickListener(v -> {
            ActivityUtil.getInstance().finishAllActivity();
            MainActivity.startActivity(this);
        });
        mBinding.ivBack.setOnClickListener(v -> {
            finish();
        });
    }

    @Override
    protected void onApplyWindowInsets() {
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
    }

    @Override
    public void networkStatus(boolean isConnected) {

    }

    @Override
    public void networkType(int type) {

    }
    public static void startActivity(Context context) {
        Intent intent = new Intent(context, ConnectSuccessActivity.class);
        context.startActivity(intent);
    }
}